New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

duplex-combination

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duplex-combination

Combine a readable and writable stream into a duplex stream

1.2.1
latest
Source
npm
Version published
Weekly downloads
16
-11.11%
Maintainers
1
Weekly downloads
 
Created
Source

duplex-combination

Merge a readable and writable stream together into a duplex stream

USE

var dp = new DuplexCombination(reader, writer, options);

dp.write("data");
dp.on('readable', function() {
    dp.read(n);
})

Additional public properties

The read and write streams are exposed with the properties dp.reader and dp.writer

ERRORS

Error events include the stream that triggered the error, so you can:

dp.on('error',function(err,stream) {
    if (stream === dp.reader) {
        // error while reading
    }
    else {
        // error while writing
    }
});

Acknowledgements

Stolen shamelessly from Isaac Schuleter's duplex-passthrough module.

Keywords

stream

FAQs

Package last updated on 25 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts